﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Values;

namespace XfTech.SmartTms.ValueObjects
{
    /// <summary>
    /// 车型大小值对象
    /// </summary>
    public class VehicleSize : ValueObject
    {
        /// <summary>
        /// 长（米）
        /// </summary>
        public float Length { get; private set; }

        /// <summary>
        /// 宽（米）
        /// </summary>
        public float Width { get; private set; }

        /// <summary>
        /// 高（米）
        /// </summary>
        public float Height { get; private set; }

        //默认构造函数（protected访问，仅用于EFCore 构造对象用）
        protected VehicleSize() { } 

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="length">长</param>
        /// <param name="width">宽</param>
        /// <param name="height">高</param>
        public VehicleSize(float length, float width, float height)
        {
            Length = length;
            Width = width;
            Height = height;
        }

        /// <summary>
        /// 重写抽象方法（获取原始值）
        /// </summary>
        /// <returns></returns>
        protected override IEnumerable<object> GetAtomicValues()
        {
            yield return Length;
            yield return Width;
            yield return Height;
        }
    }
}
